
package edu.tongji.jiaowu.dao.jdbc;
 
import java.util.List;

import edu.tongji.jiaowu.dao.ElectiveResultDelDao;
import com.tongji.quickCRUDQ.define.Row;
import com.tongji.quickCRUDQ.model.CommonBean;
import com.tongji.quickCRUDQ.dao.jdbc.BaseDaoJdbc;

public class ElectiveResultDelDaoJdbc extends BaseDaoJdbc implements ElectiveResultDelDao {
	String tableName="T_ELECTIVE_RESULT_DEL";
	String beanName="electiveResultDel";
	
	public CommonBean createElectiveResultDel(){
		CommonBean electiveResultDels=this.createBean(tableName,beanName);
                return electiveResultDels;		
	}
	
/*
	public CommonBean findElectiveResultDels(String refid) {
		CommonBean electiveResultDels=this.createElectiveResultDel();
		String sql="select * from T_ELECTIVE_RESULT_DEL where refid=?";
		List data=this.getCommonDao().select(sql,new String[]{refid});
		electiveResultDels.addData(data);
                return electiveResultDels;
       }
*/
	public CommonBean findElectiveResultDelById(String id) {
		CommonBean electiveResultDels=this.createElectiveResultDel();
		String sql="select * from T_ELECTIVE_RESULT_DEL where id=?";
		List data=this.getCommonDao().select(sql,new String[]{id});
		electiveResultDels.addData(data);
    return electiveResultDels;
  }
  
	public CommonBean findAllElectiveResultDels() {
		CommonBean electiveResultDels=this.createElectiveResultDel();
		String sql="select * from T_ELECTIVE_RESULT_DEL ";
		List data=this.getCommonDao().select(sql,new String[]{});
		electiveResultDels.addData(data);
    return electiveResultDels;
  }
	public void insertElectiveResultDel(CommonBean electiveResultDelBean){
		List data=electiveResultDelBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchInsert(row,data,this.getIdGenerator());
	}
	public void updateElectiveResultDel(CommonBean electiveResultDelBean){
		List data=electiveResultDelBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchUpdate(row,data);
	}
}

